//
//  QFStatusCell.swift
//  sinaWeibo
//
//  Created by apple on 16/3/6.
//  Copyright © 2016年 Qifeng Yan. All rights reserved.
//

import UIKit

class QFStatusCell: UITableViewCell {
    
    // MARK: - 属性 模型数据
    var status: QFStatus? {
        didSet {
            statusOriginalView.status = status // 将模型数据传递出去
        }
    }
    
    // MARK: - 构造函数
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        backgroundColor = UIColor(white: 237 / 255.0, alpha: 1)
        
        setUI()
    }

    private func setUI() {
        // 添加子控件
        contentView.addSubview(statusOriginalView)
        
        // 添加约束
        statusOriginalView.snp_makeConstraints { (make) -> Void in
            make.leading.trailing.equalTo(contentView)
            make.top.equalTo(contentView).offset(10)
//            make.height.equalTo(44)
        }
        
        // 添加contenView 的约束
        contentView.snp_makeConstraints { (make) -> Void in
            make.leading.top.trailing.equalTo(self)
            make.bottom.equalTo(statusOriginalView)
        }
        
    }
    
    // MARK: - 懒加载 QFStatusOriginalView
    lazy var statusOriginalView: QFStatusOriginalView = QFStatusOriginalView()

}
